﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>登录</title>
    <script language="JavaScript" src="/WF/Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="/WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>

    <link href="/DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />

    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="/WF/Scripts/config.js"></script>
    <script type="text/javascript" src="/WF/Comm/Gener.js"></script>

    <script type="text/javascript" language="javascript" >
        //页面启动函数.
        $(function () {

            $("#Msg").html("");

        });

        function Login() {

            $("#Msg").html("正在验证请稍候....");

            var ctrlUserNo = document.getElementById("TB_No");
            if (ctrlUserNo.value == "") {
                alert('请输入用户名');
                return;
            }

            var ctrlPass = document.getElementById("TB_PW");
            if (ctrlPass.value == "") {
                alert('请输入密码');
                return;
            }

            var emp = new Entity("BP.GPM.Emp");
            emp.No = ctrlUserNo.value;
            var i = emp.RetrieveFromDBSources();

            if (i == 0) {
                $("#Msg").html("<font color=red>用户名或者密码错误.</font>");
                return;
            }

            if (emp.Pass != ctrlPass.value) {
                $("#Msg").html("<font color=red>用户名或者密码错误.</font>");
                return;
            }

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_AppClassic");
            handler.AddFormData();
            var data = handler.DoMethodReturnString("Login_Submit");

            if (data.indexOf('err@') != -1) {
                alert(data);
                return;
            }

            window.location.href = 'Default.htm';
            return;
        }
    </script>
</head>
<body>

<form id="cc" >

<div id="Msg"></div>

<center>
<table  style=" text-align:center; " >
<caption>请您登录</caption>
<tr>
<td> 用户名</td>
<td> <input type=text  id="TB_No" name="TB_No" style="width:80%;" /> </td>
</tr>

<tr>
<td> 密码</td>
<td> <input type=text  id="TB_PW" name="TB_PW"  style="width:80%;"  /> </td>
</tr>

<tr>
<td colspan=2>  <input type=button  id="btn_Submit" value="登录"  onclick="Login();"  /> </td>
</tr>
 
</table>

<fieldset>
<legend>该页面演示了如何使用entity 查询数据。</legend>
<ul>
<li> 初始化一个entity .</li>
<li> 执行查询..</li>

</ul>
</fieldset>

</center>

</form>

</body>
</html>
